﻿/*
 参考：http://keleyi.com/a/bjac/qwcsgskp.htm
 */
using System;
using Keleyi.KFrame.KImage;

namespace KeleyiTestWeb.KImage
{
    public partial class GetImage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            string m_fileName = DateTime.Now.ToFileTime().ToString() + ".jpg";
            string m_saveName = "download/" + m_fileName;
            string m_savePath = Server.MapPath(m_saveName);

            if (KeleyiImgDownloader.DownloadPicture(tbPicUrl.Text, m_savePath, -1))
            {
                ltlTips.Text = "获取成功";
                imgDownload.ImageUrl = m_saveName;
            }
            else
                ltlTips.Text = "获取失败";
        }
    }
}